<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;">
        <div class="easyui-panel" title="" style="width:100%;max-width:400px;padding:30px 60px;">
            <form id="label_from" method="post">
                <input name="id" value="${label.data.id}" type="hidden">
                <div style="margin-bottom:20px">
                    <input class="easyui-textbox" name="name" value="${label.data.name}" id="name" style="width:100%" data-options="label:'名称:',required:true">
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    function submit_label_from(){
        var subUrl = "${pageContext.request.contextPath}/label/datapost";
        if($("#label_from").form('validate')){
            var JsonDate =  $.serializeObject($('#label_from'));
            $.ajax({
                type: "POST",
                url: subUrl,
                cache:false,
                data:JSON.stringify(JsonDate),
                dataType:"json",
                contentType:"application/json;charset=UTF-8",
                success: function(data){
                    if(data.errCode == 0){
                        parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                         parent.$.modalDialog.handler.dialog('close');
                    }else{
                        $.messager.alert('警告','操作失败');
                    }
                },
                error:function(XMLHttpRequest, textStatus, errorThrown){
                    console.info(XMLHttpRequest);
                    console.info(textStatus);
                    console.info(errorThrown);
                }
            });
        }


    }
</script>

